package iblink.core;

import com.ib.client.ScannerSubscription;

public class ScannerArgs {

	public static enum LocationCode {

		STK_US("STK.US"), STK_US_MAJOR("STK.US.MAJOR"), STK_AMEX("STK.AMEX");

		private String ibString;

		private LocationCode(String ibString) {
			this.ibString = ibString;
		}

		public String ibString() {
			return ibString;
		}
	}

	public static enum Instrument {
		STK;
	}

	public static enum ScanCode {
		HIGH_OPT_VOLUME_PUT_CALL_RATIO, LOW_OPT_VOLUME_PUT_CALL_RATIO;
	}

	ScannerSubscription sc = new ScannerSubscription();

	public ScannerArgs(LocationCode location, Instrument instrument, ScanCode scanCode) {
		sc.locationCode(location.ibString());
		sc.instrument(instrument.toString());
		sc.scanCode(scanCode.toString());
	}

	public void abovePrice(double price) {
		sc.abovePrice(price);
	}

	public void numberOfRows(int n) {
		sc.numberOfRows(n);
	}

	public ScannerSubscription asScannerSubscription() {
		return sc;
	}
}
